Goldeneye
Item Types

if > 0x18 subtract 0x19
if < 0x25 ((0x25 - 0x19) << 2) + 80053654 (still end of table) (TLB pointers to jr)


# of words for type - whoo!!!

#	words	description
01	40	Door
02	2	Door Scale (beta)
03	20	Std. Object
04	21	Key
05	20	Alarm
06	3B	Camera
07	21	Ammo Clip
08	22	Weapon
09	7	Guard
0A	40	Single-Screen Display (monitors, etc)
0B	95	Multi-Screen Display (bunker, for example)
0C	20	Monitor Rack
0D	36	Drone Guns
0E	3	Link Collectables
0F	1	N/A
10	1	N/A
11	20	Hat
12	3	Set Guard Attributes
13	4	Link Objects
14	2D	Ammo Box
15	22	Body Armour
16	4	Tag Object
17	4	Start Objective
18	1	End Objective
19	2	Destroy Object
1A	2	Complete if True
1B	2	Failed if True
1C	2	Collect Item
1D	2	Deposit Item
1E	4	Photograph Object
1F	1	N/A
20	4	Enter Room
21	5	Deposit Item in Room
22	1	Use Key Analyzer
23	4	Watch Objective Text
24	20	Gas-Releasing Object
25	A	Rename
26	4	Lock
27	2C	Wheeled Vehicles
28	2D	Aircraft
29	1	N/A
2A	20	Glass
2B	20	Safe
2C	5	Object in Safe
2D	38	Tank
2E	7	Camera
2F	25	Tinted Glass
30+	1	end setup object list


80052100 table
Other type: (note: these are # of bytes, not words in other table)
00	2	
00XX
XX = Return Value
Go into loop executing no commands but going through them until Return Value is met by 02XX Command or 04 is found and terminate

01	2
01XX
XX = Return Value
Return to start of block, Go into loop executing no commands but going through them until Return Value is met by 02XX Command or 04 is found and terminate

02	2	
02XX
XX = Return Value
In main load (not in return loop), 02 does nothing.  In the return loop, if current Return Value == XX, go to main load and start executing commands again.

03	1	iterate
04	1	terminate
05	4	jal; jump to block function with # after its pointer	05.ii.####	[i]dentifier type (FD=guard, F8=Bond),[#] of thing to jump to.  given after the pointer to the block data
also:	05 - 4 Default action for guard on the path (ex. walking wait for bond, attacking immediately, wait till bond shoots, etc), 00XX = bank at 80037450, 04XX = level specific, corresponding to table with pointers to spawn stuff

06	3	06.xxxx	set return link to start of this block.
07	1	return to original function
08	1	for about a second aim at bond but do not fire
09	1	kneel
0A	9
	0AXXXXYYYYZZZZWWWW
	XXXX = Animation offset into table (ex. swirling, running, holding gun, etc, sent list before)
	YYYY ?
	ZZZZ ?
	WWWW = some sort of speed halfword, something like that

0B	2	0B.rr	if guard is wasting time, return
0C	1	shuffle feet
0D	1	look around self
0E	2	0E.rr	step sideways, return rr	(guard action)
0F	2	0F.rr	hop sideways, return rr	(guard action)
10	2	10.rr	run sideways, return rr	(guard action)
11	2	11.rr	walk while firing, return rr	(guard action)
12	2	12.rr	run while firing, return rr	(guard action)
13	2	13.rr	roll along ground, then fire crouched, return rr	(guard action)
14	6	14.xxxx.####.rr	target guard [#], [r]eturn
15	6	15.xxxx.####.rr	kneel targetting guard [#], [r]eturn
16	6	16.xxxx.####.rr	stand (bond like) targetting guard [#], [r]eturn
17	6	17.xxxx.####.rr	stand still facing guard [#] cordially, [r]eturn value (ie. valentine, mishkin)
	guard ID#0000 is Bond.
	values for x:
		xx2x: aim, but don't fire
		xxx1: used to pinpoint bond
		xxx4: used to pinpoint guard ID#
		xxx8: used to pinpoint preset
18	4	18.##.xx.ww	Shoot GuardID# in the x with [W]eapon type#
19	4	19.#1.#2.xx	GuardID#1 shoots GuardID#2 in the x
1A	2	1A.rr	throw grenade, return rr	(guard action)
1B	5	*****1B.xxxx.##.rr	drop weapon: model [x], weapon inventory #, return rr
1B.xxxx.ww.rr	if bond within x units, drop [w]eapon inventory #, return rr
(if grenade, mine, etc dropped, they are active and will explode!)


1C	3	1C.pppp	jog to preset
1D	1	jog to predefined preset (2328)
1E	3	1E.pppp	walk to preset	
1F	3	1F.pppp	run to preset
20	2	Make path active 20XX XX = path designator from after each above path pointers
21	1	Surrender! guard throws down equipment, hands up, knees shaking!
22	1	fade away guard
23	2	23.##	eliminate guard#
24	4	24.xxxx.rr	activate object at preset
25	1	sound alarm
26	1	shut off alarm
27	2	27.rr	invalid type (only returns false)
28	2	28.rr	jog to bond.  [r]eturns when at location
29	2	29.rr	walk to bond.  [r]eturns when at location
2A	2	2A.rr	run to bond.  [r]eturns when at location
2B	2	2B.rr	invalid type (only returns false)
2C	3	2C.xx.rr	jog to character position, return on arrival
2D	3	2D.xx.rr	walk to character position, return on arrival
2E	3	2E.xx.rr	run to character position, return on arrival
	(for 2C-2E, valid values are guard ID# or F8,F9,FA,FB,FC,& FD)
2F	2	2F.rr	if guard stopped moving (arrived at destination) return rr
30	3	30.##.rr	if guard ID killed, return rr
31	3	31.##.rr	return value when bond in room with guardID#
32	2	32.rr	if Bond within sight, return rr
33	1	Seed Random Byte
34	3	34.xx.rr	if random < XX, continue to rr
35	3	35.xx.rr	if random > XX, continue to rr
36	2	36.rr	same as 37, but stores GUARDcur to SP
37	2	37.rr	if alarm activated, return rr
38	2	38.rr	if toxic gas has been released, return
39	2	39.rr	if guard sees gunfire return rr
3A	2	3A.rr	if you shoot another guard, return rr
3B	2	3B.rr	if you kill someone in front of guard, return rr
3C	2	3C.rr	if Bond in line of sight, return rr
3D	2	3D.rr	?????
3E	2	3E.rr	if you shot guard, return rr
3F	2	3F.rr	if heard bond, return rr
40	3	40.##.rr	if GUARDcur in the same room as GUARD#, return
41	2	41.rr	guard has been loaded/on screen
42	2	42.rr	if current guard on screen, return
43	2	43.rr	if guard in a room currently loaded, return
44	4	44.xxxx.rr	if room containing preset[x] is loaded, return
45	2	45.rr	if Bond has guard at gunpoint, return
46	2	46.rr	if you fired a bullet, return
47	3	47.xx.rr	if x > distance between current and Bond, return
48	3	48.xx.rr	if x < distance between current and Bond, return
49	3	49.xx.rr	similar to 47	?????
4A	3	4A.xx.rr	similar to 48	?????
4B	4	4B.pppp.rr	return if within [p]roximity of bond.  guessing clipping units.
4C	4	4C.pppp.rr	return if not within [p]roximity of bond
4D	7	4D.##.xxxx.pppp.rr	if guardID# within [x] units of [p]reset, [r]eturn value.  
4E	7	4E.##.xxxx.pppp.rr	if guardID# not within [x] units of [p]reset, [r]eturn value.  
4F	5	4F.xxxx.##.rr	If current is within x units of GuardID#, return
50	5	50.xxxx.##.rr	If current is more than x units from GuardID#, r
51	4	51.xxxx.rr	if current is within x units of any other guard, set ID# as FC and return
52	6	52.xxxx.####.rr	when within [x] units of preset #, return rr
53	6	53.xxxx.####.rr	when not within [x] units of preset #, return rr
54	5	54.##.xxxx.rr	when guard ID# is at preset [x], return rr
55	4	if step on preset xxxx, return yy
56	3	collecting item; 56.##.rr; #number of type 16 to test, [r]eturn rr
57	3	57.ii.rr	if [i]tem was depositted, return rr
58	4	58.ii.##.rr	if deposited [i]nventory value on type 16#, return rr
59	3	59.##.rr	if weapon value = ##, return rr (ie. 590133: if unarmed, return 33)
5A	3	5A.##.rr	if type16# obj loaded, return
5B	3	5B.##.rr	if tagged object not destroyed, return
5C	3	5C.##.rr	if tagged object# activated, return
5D	3	5D.##.rr	use gadget on object;	type16[#]
5E	2	5E.##	type 16# activates
5F	2	5F.##	detonate type 16#
60	2	60.##	Guard Drops type 16#
61	2	61.##	kill guard#
62	2	62.##	guard# throws equipment
63	2	63.xx	guard gives bond type16#xx item
64	3	64.xx.##	tagged obj[x] is equiped on guardID#
65	4	65.##.xxxx	move object to preset (16-object for plane, then preset)
66	2	open door with type 16#xx
67	2	close door with type 16#xx
68	4	68.##.ss.rr	check [s]tate of door type16#, [r]eturn if true.
	states:
		01: closed
		02: open
		04: closing
		08: opening
69	3	69.##.rr	if object is a valid loaded door, return
6A	3	6A.##.xx	set lock value to x for door type16#	(anything >0 should lock)
6B	3	6B.##.xx	unset lock value for door type16#
6C	4	6C.##.xx.rr	if tagged door's lock bits toggled, return
6D	3	6D.##.rr	if objective number complete, return rr
6E	3	6E.xx.rr	set guard's 2328.  Options:
6F	3	6F.xx.rr	similar or same as to 6E ???
		20	next step in path
		10	Bond's current location
		08	Bond's location so long as within certain range
		04	""
		02	""
		01	""

70	3	70.xx.rr	if difficulty > x, return rr
	0=secret, 1=00, 2=007
71	3	71.xx.rr	if difficulty < x, return rr
	1=agent, 2=secret, 3=00, 4=007
72	4	72.xxxx.rr	if x > time in stage, return
73	4	73.xxxx.rr	if x < time in stage, return
74	4	74.xxxx.rr	if x > time since power on, return
75	4	75.xxxx.rr	if x < time since power on, return
76	3	76.##.rr	if stage# < x, return
77	3	77.##.rr	if stage# > x, return
78	3	78.xx.rr	if shot guard fewer than x times, return
79	3	79.xx.rr	if shot guard more than x times, return
7A	3	7A.xx.rr	if x > 	number of near-miss shots, return
7B	3	7B.xx.rr	if x < 	number of near-miss shots, return
7C	4	7C.##.xx.rr	if guard ID#'s health above [x], return [r]
7D	4	7D.##.xx.rr	if guard ID#'s health below [x], return [r]
7E	3	7E.##.rr	if guard#'s bitflag 01000000 set, return	?????
7F	3	7F.xx.rr	if health below xx, return rr
80	3	80.xx.rr	if health above xx, return rr
81	2	81.xx	set GUARDoffset 0x10C
82	2	82.xx	adds x to G.o. 0x10C or limits to FF
83	2	83.xx	subtracts x from G.o. 0x10C or reduces to 0
84	3	84.xx.rr	if x > GUARDoffset 0x10C, return
85	2	85.rr	if GUARDoffsets 0x10C < random, return
86	2	86.xx	sets GUARD offset 0x10D
87	2	87.xx	add x to GUARDoffset 0x10D or limits to 0xFF
88	2	88.xx	subtracts x from G.o. 0x10D or reduces to 0
89	3	89.xx.rr	if x > GUARDoffset 0x10D, return
8A	2	8A.rr	if GUARDoffsets 0x10D < seeded byte, return
8B	3	8B.xxxx	sets GUARD offset 0xEC	hearing
8C	2	8C.xx	sets GUARD offset 0xD0	reaction time
8D	2	8D.xx	sets GUARD offset 0x10	?????
8E	2	8E.##	set current guard's ID#
8F	3	8F.xxxx	sets guard health
90	3	90.xxxx	sets guard body armour amount
ie:	blue beret = 0050
	red beret = 003C
	black beret = 0014

91	2	91.xx	sets GUARD offset 0x3	?????
92	2	92.xx	sets GUARD offset 0xD	?????
93	2	93.xx	sets GUARD offset 0x2	?????
94	2	94.xx	mask GUARD guard type with x
95	2	95.xx	unmask GUARD guard type with x
96	3	96.xx.rr	if GUARD type bits masked, return
97	3	97.##.xx	mask type of guardID# with x
98	3	98.##.xx	unmask guard# type with x
99	4	99.##.xx.rr	if guard# type set, return
	types:
		01: listen to commands?
		04: ? - trev in cradle (040F)
		80: scientist

9A	5	9A.xxxxxxxx	Set Objective Bits
9B	5	9B.xxxxxxxx	Unset Objective Bits
9C	6	9C.xxxxxxxx.rr	Check if Objective Value, Return Loop if so
9D	5	9D.xxxxxxxx	set Guard bits
9E	5	9E.xxxxxxxx	unset guard bits
9F	6	9F.xxxxxxxx.rr	if guard bits same, return rr
A0	6	A0.##.xxxxxxxx	Set Tags for Guard ID#
A1	6	A1.##.xxxxxxxx	UnSet Tags for Guard ID#
A2	7	A2.##.xxxxxxxx.rr	if tags for guard ID# xxxxxxxx, return rr
	guard tags:
		00000001: ?-unset in cradle (041A) 
		00000002: sunglasses (where applicable)
		00000010: invincible
		00000020: ? - guards in dam (040D)
		00000040: can shoot guards
		00000200: ? - Twhere in cradle (0412)
		00000400: ? - fall in cradle (041F)
		00000800: standard clipping (allows him to handle ramps and stuff)
		00001000: ? - jump part of dam
		00002000: ? - jump part of dam
		00004000: ? - set when trev falls in cradle (0418)
		00008000: ? - set when trev starts attacking you (0418)
		00010000: ? - cuba
		00020000: ? - cuba 
		00080000: ? - trev in cradle (0408)
		00100000: scientist
		00400000: ? statue guards

A3	6	A3.##.xxxxxxxx	set tagged object# bits (0x8 offset)
A4	6	A4.##.xxxxxxxx	unset tagged object# bits (0x8 offset)
A5	7	A5.##.xxxxxxxx	if tagged object# bits toggled, return (0x8)
	object tags:
		00100000: uncollectable
		00040000: visible?
		00020000: invincible?

A6	6	A6.##.xxxxxxxx	set tagged object# bits (0xC offset)
A7	6	A7.##.xxxxxxxx	unset tagged object# bits (0xC offset)
A8	7	A8.##.xxxxxxxx	if tagged object# bits toggled, return (0xC)
	door tags:
		10000000: locked
		04000000:
		00080000: invisible
A9	2	A9.##	guardID# set to FC
AA	3	AA.#1.#2	set FC value for guardID#1 to #2
AB	3	AB.xxxx	set object to y coordinate of xxxx preset //SubDrag...
		AB.xxxx	set guard's 2328 value to x //me...
AC	4	AC.##.xxxx	set guardID#'s 2328 value to x
AD	1	debug text or comments follow.  ascii, terminated with 00.  Must contain some text or will fail!
AE	1	reset loop counter and enable it	(set 40 bit)
AF	1	reset loop counter
B0	1	disable loop counter	(unset 40 bit)
B1	1	enable loop counter	(set 40 bit)
B2	2	B2.rr	if loop counter enabled, return rr	(checks 40 bit)
B3	5	B3.xxxxxx.rr	if cycle counter < value, return rr
B4	5	B4.xxxxxx.rr	if cycle counter > value, return rr
B5	1	Show Timer
B6	1	Hide Timer (Silent Countdown)
B7	3	Set Timer X seconds (Doesn't show timer yet)
B8	1	Stop Timer
B9	1	Start Timer
BA	3	BA.rr	return if timer enabled
BB	4	BB.xxxx.rr	if timer < x, return
BC	4	BC.xxxx.rr	if timer > x, return
BD	C	spawn guard	bb.hh.pppp.aaaa.bbbbbbbb.rr [b]ody, [h]ead, into path table(00=use actual preset number for spawn), [p]reset position (23xx for path table), [a]ction, 
BE	B	spawn guard...  BE.bb.hh.tt.aaaa.00000000.rr	(unused in bunker1)
	[t]ype indicates current guard ID, bonds, etc...
	flags:
	00000001	sunglasses (when applicable)
	00000002	
	00000010	scientist?  can kill own?
BF	9	weapons	BF.mmmm.WW.hh000000.rr	[m]odel, [w]eapon inventory #, [h]and - 00 normal, 80=right+90=left for doubles, [r]eturn value if loaded okay 
C0	8	hats	C0.mmmm.00000000.rr	[m]odel, [r]eturn value if loaded okay
C1	5	C1.##.xxxx.rr	guard# does action x if hears a lot of gunfire, return when action complete
C2	3	lower display text (text bank values); C2.xxxx
C3	3	upper display text (text bank values); C3.xxxx
C4	4	C4.xxxx.##	set sound effect x in slot #
C5	5	C5.##.jj.xxxx	set audible range [x] for sound# from ob[j]
C6	6	C6.##.pppp.xxxx	set audible range [x] for sound# from [p]reset
C7	6	C7.##.vvvv.xxxx	sound # crecendos to [v]olume over [x] milliseconds
C8	6	C8.##.vvvv.xxxx	sound # fades from [v]olume over [x] milliseconds
C9	2	C9.##	shut off sound# (max of 8)
CA	5	CA.##.xxxx.rr	if x > remaining time for SE, return
CB	2	CB.##	use path # (sets A4 & A8 in obj data)
CC	5	CC.xxxx.yyyy	set speed for type 27 object; x is speed, y amount of time to reach full speed
CD	5	CD.xxxx.yyyy	set speed [x] of aircraft rotor (plane prop, etc.)
CE	2	"Detect if Currently in Intro Camera", return if so
CF	2	"Detect if Currently in Intro Swirl", return if so
D0	4	D0.##.ii.aa	change type16# monitor [a]nimation to aa.  [i]mage slot to be replaced is set here (for 0B multi image monitors)
D1	2	D1.rr	if in tank, return
D2	1	exit level
D3	1	Return from Camera scene, Careful Everything is Reset
D4	3	D4.xxxx	set camera to preset and focus on Bond
D5	6	D5.##.xxxx.yyyy	set camera focus to tagged Camera#.  If x=1, focus on Bond and ignore camera rotation.  y can be set but is not used in-game.
D6	4	D6.yyyy.rr	at elevation y return rr (uses clipping values methinks)
D7	2	D7.xx	Disables text.
	by default, disables on-screen ammo
	subsequent calls will re-enable text
bitflag controls:
	xxx1	do not disable upper text display
	xx1x	do not disable lower text display
	x1xx	do not disable on-screen clock
note: the clock is disabled differently than types B5/B6, so you must use D7 or D8 to re-enable 
	
D8	1	Enable all on-screen text displays
should only be called after D7 command, since it may toggle upper/lower text disaplays

D9	5	D9.##.xxxx.rr	guard ID#(or FD for current) moved to preset.  return when true
DA	1	fade out for cut-scene
DB	1	fade in from black (reset for DA type)
DC	2	DC.rr	return when fade is complete
DD	1	Remove Guards (they're just gone, no firing, nothing, including Bond image)
DE	1	Bring Guards Back
DF	2	DF.##	open type 16# door.  used in cutscenes
E0	3	E0.##.xx	GuardID# draws weapon x (0 disarms)
E1	3	E1.xx.rr	if at least x #players playing, return
E2	4	E2.##.xx.rr	if x > total ammo of type#, return
E3	2	E3.ww	draw weapon type (1st person)
E4	2	E4.ww	draw weapon type (3rd person)
E5	3	E5.xxxx	set bond's speed (continues in last used direction)
E6	5	E6.##.xxxx.rr	return if tagged obj and preset are in same room
E7	2	E7.rr	if guard walking or running while shooting, return
E8	2	E8.rr	if guard is shooting, return
E9	1	E9	instantly switch to solo sky 2
EA	1	EA	stop time
EB	2	EB.xx	on Key-Press, return xx
EC	1	EC	disable player pickups
ED	1	hide 1st person display (left hand, weapon etc)
EE	D	cuba circular camera
	EE.xxxx.yyyy.zzzz.uuuu.vvvv.wwww
	x: lateral distance away from bond
	y: vertical distance from bond
	z: rate of spin
	u: preset used as focus point for angle
	v: offset to y axis, relative to preset
	w: inital rotation, relative to preset
	(because the camera focuses directly on the preset, v and w offset the camera's focus relative to the preset.  It is as though you moved the preset itself that much.  x and y set the camera's distance from the preset while focusing on the point.)

EF	1	EF	Start credits (credits at 80036440)
F0	2	F0.rr	return when credits finished
F1	2	F1.rr	if objectives complete, return rr
F2	3	F2.##.rr	if selected Bond=#, return rr
F3	2	F3.rr	if guard loaded return rr
		(NOW:	if player pickups disabled, return)
		must disab;e spawning if bond not loaded or active

F4	4	F4.0s.xx.yy	Plays x-theme	slot# =0-3; play for x/y seconds
	x is decremented even while the song can't be heard
	y is only decremented while the song is playing
	the slot dictates the theme played when more than one song is registered
F5	2	F5.xx	turn off music in slot 0-3 or all music (FF)
F6	1	Trigger Explosions Around Bond (like plastique detonate)
F7	3	counts scientists who are dead F7.##.rr
F8	3	F8.##.rr if guardID#'s 00200000 bitflag, unset & return
F9	1	F9	set "Killed in Action"
FA	1	FA	Fawn on shoulder
FB	1	FB	blend into x-sky
	(warning! in stages with gas-releasing objects this will activate the gas)
FC	2	FC.##	drop tagged obj from rack, guard, etc
FD	not valid, end of table 

for all types that use guard ID:
	F8 Bond
	F9 guard path
	FA writable guardID#
	FB writable guardID# - recently shot 
	FC writable guardID#
	FD is current guard (one calling routine, if applicable)
------------------
runway 12s
A6,A3,A0,9E,9C,9A
------------------
